import request from '../axios'
// 比赛全部api

// 获取比赛阶段列表（主要用于筛选)
const gameStage = (data) => {
  return request({
    url: '/custom/owens/stages',
    method: 'get',
    data
  })
}
// 获取比赛组别列表
const groups = data => {
  return request({
    url: '/custom/owens/groups',
    method: 'get',
    data
  })
}
// 获取我的大会信息
/**
 * @param {group_id} data 组别ID
 * @param {stage_id} data 阶段ID
 */
const info = data => {
  return request({
    url: '/custom/owens/game/info',
    method: 'get',
    params: data
  })
}
// 获取作品列表
/**
 * @param {keyword} data 姓名或手机号
 * @param {stage_id} data 阶段ID
 * @param {group_id} data 组别ID
 */
const works = data => {
  return request({
    url: '/custom/owens/works',
    method: 'get',
    params: data
  })
}
// 获取作品详情
/**
 *
 * @param {work} data 作品ID
 */
const worksDesc = (data, work) => {
  return request({
    url: `/custom/owens/works/${work}`,
    method: 'get',
    params: data
  })
}
// 获取晋级名单
/**
 * @param {keyword} data 姓名或手机号查询
 * @param {stage_id} data 阶段ID
 * @param {group_id} data 组别ID 不传则展示全部组别的晋级名单
 */
const advanceList = (data) => {
  return request({
    url: `/custom/owens/advance/list`,
    method: 'get',
    params: data
  })
}

export default { gameStage, groups, info, works, worksDesc, advanceList }
